﻿using ProjectFootball.MVC.Foundation;
using ProjectFootball.MVC.Foundation.ResourceLibrary;
using ProjectFootball.MVC.Models.EntityFramework.Entities;
using ProjectFootball.MVC.Models.RepositoryProviders;
using System;
using System.Web.Mvc;

namespace ProjectFootball.MVC.Areas.VenueArea.Controllers
{
    public class DetailsController : BaseController
    {
        #region Constructor
        public DetailsController(IRepositoryProvider provider)
            : base(provider)
        {
        }
        #endregion

        #region //VenueArea/Details
        public ActionResult Index(Guid id)
        {
            var venue = Provider.VenueRepository.SearchByPrimaryKey(id);

            if (venue == null)
                return RedirectHome;

            return View(venue.GetSearchResultViewModel(User, SearchType.Details));
        }
        #endregion
    }
}
